/*    */ package com.wgcloud.service;
/*    */ 
/*    */ import com.github.pagehelper.PageHelper;
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.FileWarnInfo;
/*    */ import com.wgcloud.mapper.FileWarnInfoMapper;
/*    */ import com.wgcloud.mapper.FileWarnStateMapper;
/*    */ import com.wgcloud.util.DateUtil;
/*    */ import com.wgcloud.util.UUIDUtil;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.apache.commons.lang3.StringUtils;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Service;
/*    */ import org.springframework.transaction.annotation.Transactional;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Service
/*    */ public class FileWarnInfoService
/*    */ {
/*    */   @Autowired
/*    */   private FileWarnInfoMapper fileWarnInfoMapper;
/*    */   @Autowired
/*    */   private FileWarnStateMapper fileWarnStateMapper;
/*    */   
/*    */   public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
/* 30 */     PageHelper.startPage(currPage, pageSize);
/* 31 */     List<FileWarnInfo> list = this.fileWarnInfoMapper.selectByParams(params);
/* 32 */     PageInfo<FileWarnInfo> pageInfo = new PageInfo(list);
/* 33 */     return pageInfo;
/*    */   }
/*    */   
/*    */   public void save(FileWarnInfo fileWarnInfo) throws Exception {
/* 37 */     fileWarnInfo.setId(UUIDUtil.getUUID());
/* 38 */     fileWarnInfo.setCreateTime(DateUtil.getNowTime());
/* 39 */     if (!StringUtils.isEmpty(fileWarnInfo.getFilePath())) {
/* 40 */       fileWarnInfo.setFilePath(fileWarnInfo.getFilePath().trim());
/*    */     }
/* 42 */     this.fileWarnInfoMapper.save(fileWarnInfo);
/*    */   }
/*    */   
/*    */   public int deleteByHostName(Map<String, Object> map) throws Exception {
/* 46 */     return this.fileWarnInfoMapper.deleteByHostName(map);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public void saveRecord(List<FileWarnInfo> recordList) throws Exception {
/* 51 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 54 */     for (FileWarnInfo as : recordList) {
/* 55 */       as.setId(UUIDUtil.getUUID());
/*    */     }
/* 57 */     this.fileWarnInfoMapper.insertList(recordList);
/*    */   }
/*    */   
/*    */   public Integer countByParams(Map<String, Object> params) throws Exception {
/* 61 */     return this.fileWarnInfoMapper.countByParams(params);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public int deleteById(String[] id) throws Exception {
/* 66 */     return this.fileWarnInfoMapper.deleteById(id);
/*    */   }
/*    */   
/*    */   @Transactional
/*    */   public void updateRecord(List<FileWarnInfo> recordList) throws Exception {
/* 71 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 74 */     this.fileWarnInfoMapper.updateList(recordList);
/*    */   }
/*    */ 
/*    */   
/*    */   public void updateById(FileWarnInfo fileWarnInfo) throws Exception {
/* 79 */     this.fileWarnInfoMapper.updateById(fileWarnInfo);
/*    */   }
/*    */   
/*    */   public FileWarnInfo selectById(String id) throws Exception {
/* 83 */     return this.fileWarnInfoMapper.selectById(id);
/*    */   }
/*    */   
/*    */   public List<FileWarnInfo> selectAllByParams(Map<String, Object> params) throws Exception {
/* 87 */     return this.fileWarnInfoMapper.selectAllByParams(params);
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/service/FileWarnInfoService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */